home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 November / CHIP Kasım 1996.iso / ms / visualj / vjtrialb.exe / RCDATA / CABINET / MFCAPWZ.DLL / TEMPLATE / IPFRAME.CPP < prev    next >
C/C++ Source or Header  |  1996-07-31  |  4KB  |  142 lines

  1. // $$ipframe_ifile$$.cpp : implementation of the $$IPFRAME_CLASS$$ class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "$$root$$.h"
  6.  
  7. #include "$$ipframe_hfile$$.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // $$IPFRAME_CLASS$$
  17.  
  18. IMPLEMENT_DYNCREATE($$IPFRAME_CLASS$$, $$IPFRAME_BASE_CLASS$$)
  19.  
  20. BEGIN_MESSAGE_MAP($$IPFRAME_CLASS$$, $$IPFRAME_BASE_CLASS$$)
  21.     //{{AFX_MSG_MAP($$IPFRAME_CLASS$$)
  22.     ON_WM_CREATE()
  23.     //}}AFX_MSG_MAP
  24. $$IF(HELP)
  25.     // Global help commands
  26.     ON_COMMAND(ID_HELP_FINDER, $$IPFRAME_BASE_CLASS$$::OnHelpFinder)
  27.     ON_COMMAND(ID_HELP, $$IPFRAME_BASE_CLASS$$::OnHelp)
  28.     ON_COMMAND(ID_DEFAULT_HELP, $$IPFRAME_BASE_CLASS$$::OnHelpFinder)
  29.     ON_COMMAND(ID_CONTEXT_HELP, $$IPFRAME_BASE_CLASS$$::OnContextHelp)
  30. $$ENDIF
  31. END_MESSAGE_MAP()
  32.  
  33. /////////////////////////////////////////////////////////////////////////////
  34. // $$IPFRAME_CLASS$$ construction/destruction
  35.  
  36. $$IPFRAME_CLASS$$::$$IPFRAME_CLASS$$()
  37. {
  38. }
  39.  
  40. $$IPFRAME_CLASS$$::~$$IPFRAME_CLASS$$()
  41. {
  42. }
  43.  
  44. int $$IPFRAME_CLASS$$::OnCreate(LPCREATESTRUCT lpCreateStruct)
  45. {
  46.     if ($$IPFRAME_BASE_CLASS$$::OnCreate(lpCreateStruct) == -1)
  47.         return -1;
  48.  
  49. $$IF(VERBOSE)
  50.     // CResizeBar implements in-place resizing.
  51. $$ENDIF
  52.     if (!m_wndResizeBar.Create(this))
  53.     {
  54.         TRACE0("Failed to create resize bar\n");
  55.         return -1;      // fail to create
  56.     }
  57.  
  58. $$IF(VERBOSE)
  59.     // By default, it is a good idea to register a drop-target that does
  60.     //  nothing with your frame window.  This prevents drops from
  61.     //  "falling through" to a container that supports drag-drop.
  62. $$ENDIF
  63.     m_dropTarget.Register(this);
  64.  
  65.     return 0;
  66. }
  67.  
  68. $$IF(TOOLBAR)
  69. $$IF(VERBOSE)
  70. // OnCreateControlBars is called by the framework to create control bars on the
  71. //  container application's windows.  pWndFrame is the top level frame window of
  72. //  the container and is always non-NULL.  pWndDoc is the doc level frame window
  73. //  and will be NULL when the container is an SDI application.  A server
  74. //  application can place MFC control bars on either window.
  75. $$ENDIF
  76. BOOL $$IPFRAME_CLASS$$::OnCreateControlBars(CFrameWnd* pWndFrame, CFrameWnd* pWndDoc)
  77. {
  78. $$IF(VERBOSE)
  79.     // Set owner to this window, so messages are delivered to correct app
  80. $$ENDIF
  81.     m_wndToolBar.SetOwner(this);
  82.  
  83. $$IF(VERBOSE)
  84.     // Create toolbar on client's frame window
  85. $$ENDIF
  86.     if (!m_wndToolBar.Create(pWndFrame) ||
  87. $$IF(PROJTYPE_MDI)
  88.         !m_wndToolBar.LoadToolBar(IDR_$$DOC$$TYPE_SRVR_IP))
  89. $$ELSE
  90.         !m_wndToolBar.LoadToolBar(IDR_SRVR_INPLACE))
  91. $$ENDIF
  92.     {
  93.         TRACE0("Failed to create toolbar\n");
  94.         return FALSE;
  95.     }
  96.  
  97. $$IF(VERBOSE)    
  98.     // TODO: Remove this if you don't want tool tips or a resizeable toolbar
  99. $$ENDIF
  100.     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  101.         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
  102.  
  103. $$IF(VERBOSE)
  104.     // TODO: Delete these three lines if you don't want the toolbar to
  105.     //  be dockable
  106. $$ENDIF
  107.     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  108.     pWndFrame->EnableDocking(CBRS_ALIGN_ANY);
  109.     pWndFrame->DockControlBar(&m_wndToolBar);
  110.  
  111.     return TRUE;
  112. }
  113.  
  114. $$ENDIF //TOOLBAR
  115. BOOL $$IPFRAME_CLASS$$::PreCreateWindow(CREATESTRUCT& cs)
  116. {
  117. $$IF(VERBOSE)
  118.     // TODO: Modify the Window class or styles here by modifying
  119.     //  the CREATESTRUCT cs
  120.  
  121. $$ENDIF //VERBOSE
  122.     return $$IPFRAME_BASE_CLASS$$::PreCreateWindow(cs);
  123. }
  124.  
  125. /////////////////////////////////////////////////////////////////////////////
  126. // $$IPFRAME_CLASS$$ diagnostics
  127.  
  128. #ifdef _DEBUG
  129. void $$IPFRAME_CLASS$$::AssertValid() const
  130. {
  131.     $$IPFRAME_BASE_CLASS$$::AssertValid();
  132. }
  133.  
  134. void $$IPFRAME_CLASS$$::Dump(CDumpContext& dc) const
  135. {
  136.     $$IPFRAME_BASE_CLASS$$::Dump(dc);
  137. }
  138. #endif //_DEBUG
  139.  
  140. /////////////////////////////////////////////////////////////////////////////
  141. // $$IPFRAME_CLASS$$ commands
  142.